home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / res / MessageStyles / Modern Bubbling.AdiumMessageStyle / Contents / Resources / javascripts / scroll.js < prev   
Encoding:
JavaScript  |  2009-07-24  |  1.0 KB  |  32 lines

  1. /* This file provides the smooth scrolling effect via Javascript. If you don't like it, just delete it! */
  2.  
  3. //Auto-scroll to bottom.  Use nearBottom to determine if a scrollToBottom is desired.
  4. function nearBottom()
  5. {
  6.     return (window.pageYOffset >= (document.body.offsetHeight - (window.innerHeight * 1.2)));
  7. }
  8.  
  9. var intervall_scroll;
  10.  
  11. function scrollToBottom()
  12. {
  13.     window.scrollTo(window.pageXOffset, document.body.offsetHeight);
  14.     return;
  15.  
  16.     /*
  17.     if ( intervall_scroll ) clearInterval( intervall_scroll );
  18.     intervall_scroll = setInterval( function() {
  19.         var target_scroll = (document.body.scrollHeight-window.innerHeight);
  20.         var scrolldiff = target_scroll - document.body.scrollTop;
  21.         if ( document.body.scrollTop != target_scroll ) {
  22.             var saved_scroll = document.body.scrollTop;
  23.             document.body.scrollTop += scrolldiff / 5 + ( scrolldiff >= 0 ? (scrolldiff != 0 ) : -1 );
  24.          } else {
  25.              saved_scroll = -1;
  26.             clearInterval( intervall_scroll );
  27.          }
  28.     } , 10 );
  29.     return;
  30.     */
  31. }
  32.